//请求接口获取数据
export const requestJsonData = (url,) => {
    return new Promise((resolve, reject) => {
        debugger
        let xhr = new XMLHttpRequest()
        xhr.open('get', url)
        xhr.onload = function () {
            let {data, code, msg} = JSON.parse(xhr.responseText)
            if (code === 0) return resolve(data)
            else return reject(msg)
        }
        xhr.send()
    })
}
